import request from '@/utils/request'

export function getCandidates(data, offset, limit) {
  return request({
    url: '/candidate',
    method: 'get',
    params: {
      recruitId: data.recruitId,
      status: data.status,
      offset: offset,
      limit: limit
    }
  })
}

export function addCandidate(data) {
  return request({
    url: '/candidate',
    method: 'post',
    data
  })
}

export function modifyCandidate(id, data) {
  return request({
    url: `/candidate/${id}`,
    method: 'put',
    data
  })
}

export function modifyCandidateStatus(id, status) {
  return request({
    url: `/candidate/status/${id}?status=${status}`,
    method: 'put'
  })
}
